package com.enki.cigarettes.entity;

import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * @author Glory
 * @version 1.0
 * @time 2019-01-23 15:32
 * @Description TODO
 */
@Entity
@Table(name = "integral_rules_t", schema = "e_cigarettes_shop", catalog = "")
public class IntegralRulesT {
    private String id;
    private String name;
    private int type;
    private int score;
    private Integer orderPriceRangeMin;
    private Integer orderPriceRangeMax;
    private String statics;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    private Boolean removed;

    @Id
    @Column(name = "id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "type")
    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    @Basic
    @Column(name = "score")
    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    @Basic
    @Column(name = "order_price_range_min")
    public Integer getOrderPriceRangeMin() {
        return orderPriceRangeMin;
    }

    public void setOrderPriceRangeMin(Integer orderPriceRangeMin) {
        this.orderPriceRangeMin = orderPriceRangeMin;
    }

    @Basic
    @Column(name = "order_price_range_max")
    public Integer getOrderPriceRangeMax() {
        return orderPriceRangeMax;
    }

    public void setOrderPriceRangeMax(Integer orderPriceRangeMax) {
        this.orderPriceRangeMax = orderPriceRangeMax;
    }


    @Column(name = "static_key", nullable = false, length = 45)
    public String getstatics() {
        return this.statics;
    }

    public void setstatics(String statics) {
        this.statics = statics;
    }

    @Basic
    @Column(name = "create_time")
    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "update_time")
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "removed")
    public Boolean getRemoved() {
        return removed;
    }

    public void setRemoved(Boolean removed) {
        this.removed = removed;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        IntegralRulesT that = (IntegralRulesT) o;
        return type == that.type &&
                removed == that.removed &&
                Objects.equals(id, that.id) &&
                Objects.equals(name, that.name) &&
                Objects.equals(score, that.score) &&
                Objects.equals(orderPriceRangeMin, that.orderPriceRangeMin) &&
                Objects.equals(orderPriceRangeMax, that.orderPriceRangeMax) &&
                Objects.equals(statics, that.statics) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, type, score, orderPriceRangeMin, orderPriceRangeMax, statics, createTime, updateTime, removed);
    }
}
